package com.ryskoo.catering.dinnertabletype.service;

import com.ryskoo.catering.dinnertabletype.domain.DinnerTableTypePO;
import com.ryskoo.catering.dinnertabletype.repository.IDinnerTableTypeRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
@Transactional
public class DinnerTableTypeServiceImpl extends BasicServiceImpl<DinnerTableTypePO> implements IDinnerTableTypeService {

    @Autowired
    private IDinnerTableTypeRepository dinnerTableTypeRepository;

    @PostConstruct
    public void init() {
        this.setDao(dinnerTableTypeRepository);
    }

    @Override
    public List<DinnerTableTypePO> getListByVendorId(String vendorId) {
        return dinnerTableTypeRepository.getListByVendorId(vendorId);
    }

    @Override
    public List<String> getUuidByNameAndVendorId(String name, String vendorId) {
        return dinnerTableTypeRepository.getUuidByNameAndVendorId(name,vendorId);
    }

    @Override
    public List<String> getUuidByNameAndVendorIdForUpdate(String name, String vendorId, String uuid) {
        return dinnerTableTypeRepository.getUuidByNameAndVendorIdForUpdate(name,vendorId,uuid);
    }
}
